<fieldset class="f-profile"  style="width:470px; float:right;" id="fieldset-profile-height"><legend class="le-profile">??????????????</legend>
                            <div style="margin:1px 5px 5px 5px; padding-left:10px;">
                            <table>
                            <?php
							$sql = "SELECT sex, agebegin, ageend, totalfat,saturatedfat,cholestoral,protein,carbohydrate,dietaryfiber,vitamina,thiamin,riboflavin,niacin,vitaminb6,folicacid,biotin,panlothenicacid,vitaminb12,vitaminc,vitamind,vitamine,vitamink,calcium,phosphorus,iron,iodine,magnesium,zinc,copper,potassium,sodium, manganese, selenium, fluoride, molybdenum, chromium, chloride FROM agenutritent  WHERE sex = (SELECT userdata.sex FROM userdata WHERE userid = '$_SESSION[userid]') AND agebegin <= (SELECT DATE_FORMAT(NOW(),'%Y')-SUBSTRING(userdata.brithday,1,4) AS userold FROM userdata WHERE userid = '$_SESSION[userid]') AND ageend >= (SELECT DATE_FORMAT(NOW(),'%Y')-SUBSTRING(userdata.brithday,1,4) AS userold FROM userdata WHERE userid = '$_SESSION[userid]')";
							$result = mysql_query($sql);
							$row = mysql_fetch_array($result);
							$sql1="SELECT
(SELECT SUM(totalcallory) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as totalcallory,
(SELECT SUM(fatcallory) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as fatcallory,
(SELECT SUM(totalfat) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as totalfat,
(SELECT SUM(saturatedfat) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]'  ) as saturatedfat,
(SELECT SUM(cholestoral) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as cholestoral,
(SELECT SUM(protein) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as protein,
(SELECT SUM(carbohydrate) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as carbohydrate,
(SELECT SUM(dietaryfiber) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as dietaryfiber,
(SELECT SUM(vitamina) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitamina,
(SELECT SUM(thiamin) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as thiamin,
(SELECT SUM(riboflavin) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as riboflavin,
(SELECT SUM(niacin) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as niacin,
(SELECT SUM(vitaminb6) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitaminb6,
(SELECT SUM(folicacid) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as folicacid,
(SELECT SUM(biotin) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as biotin,
(SELECT SUM(panlothenicacid) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as panlothenicacid,
(SELECT SUM(vitaminb12) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitaminb12,
(SELECT SUM(vitaminc) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitaminc,
(SELECT SUM(vitamind) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitamind,
(SELECT SUM(vitamine) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitamine,
(SELECT SUM(vitamink) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as vitamink,
(SELECT SUM(calcium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as calcium,
(SELECT SUM(phosphorus) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as phosphorus,
(SELECT SUM(iron) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as iron,
(SELECT SUM(iodine) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as iodine,
(SELECT SUM(magnesium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as magnesium,
(SELECT SUM(zinc) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as zinc,
(SELECT SUM(copper) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as copper,
(SELECT SUM(potassium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as potassium,
(SELECT SUM(sodium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as sodium,
(SELECT SUM(manganese) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as manganese,
(SELECT SUM(selenium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as selenium,
(SELECT SUM(fluoride) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as fluoride,
(SELECT SUM(molybdenum) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as molybdenum,
(SELECT SUM(chromium) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as chromium,
(SELECT SUM(chloride) FROM food LEFT JOIN usermenudiet ON food.foodid = usermenudiet.foodid WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]' ) as chloride
FROM
usermenudiet WHERE menudate = STR_TO_DATE('$menudate','%d-%m-%Y') AND userid = '$_SESSION[userid]'";
								$result1 = mysql_query($sql1);
								$row1=mysql_fetch_array($result1);
									function colorDiv($set,$get){
											if($set > $get) { 
												echo "yellow"; 
											} else if ($set == $get) { 
												echo "green"; 
											} else if ($set < $get) { 
												echo "red"; 
											}
										}
										function percentage($set,$get){
											if($get == "0"){
												echo "??????????????";
											} elseif ($set == "0") {
												echo "0";
											} else {
												echo $percentage = round(($get/$set)*100,2);
											}
										}
							?>
                            <thead>
                              <tr>
                                <th>????????</th>
                                <th>???????</th>
                                <th>??????</th>
                                <th>??????? %</th>
                              </tr>
                              </thead>
                              <tbody class="tbody-food">
                              <tr>
                                <td>????????????(g)</td>
                                <td><?php echo $set = round($row['2'], 2);  ?></td>
                                <td><?php echo $get = round($row1['2'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????????(g)</td>
                                <td><?php echo $set = round($row['3'], 2);  ?></td>
                                <td><?php echo $get = round($row1['2'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????????? (mg)</td>
                                <td><?php echo $set = round($row['4'], 2);  ?></td>
                                <td><?php echo $get = round($row1['3'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????? (mg)</td>
                                <td><?php echo $set = round($row['5'], 2);  ?></td>
                                <td><?php echo $get = round($row1['4'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>???????????? (g)</td>
                                <td><?php echo $set = round($row['6'], 2);  ?></td>
                                <td><?php echo $get = round($row1['5'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (g)</td>
                                <td><?php echo $set = round($row['7'], 2);  ?></td>
                                <td><?php echo $get = round($row1['6'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (ug RE)</td>
                                <td><?php echo $set = round($row['8'], 2);  ?></td>
                                <td><?php echo $get = round($row1['7'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? 1 (mg)</td>
                                <td><?php echo $set = round($row['9'], 2);  ?></td>
                                <td><?php echo $get = round($row1['8'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? 2 (mg)</td>
                                <td><?php echo $set = round($row['10'], 2);  ?></td>
                                <td><?php echo $get = round($row1['9'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (mg NE)</td>
                                <td><?php echo $set = round($row['11'], 2);  ?></td>
                                <td><?php echo $get = round($row1['10'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? 6 (mg)</td>
                                <td><?php echo $set = round($row['12'], 2);  ?></td>
                                <td><?php echo $get = round($row1['11'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????? ????? (ug)</td>
                                <td><?php echo $set = round($row['13'], 2);  ?></td>
                                <td><?php echo $get = round($row1['12'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (ug)</td>
                                <td><?php echo $set = round($row['14'], 2);  ?></td>
                                <td><?php echo $get = round($row1['13'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????????? ????? (mg)</td>
                                <td><?php echo $set = round($row['15'], 2);  ?></td>
                                <td><?php echo $get = round($row1['14'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? 12 (ug)</td>
                                <td><?php echo $set = round($row['16'], 2);  ?></td>
                                <td><?php echo $get = round($row1['15'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (mg)</td>
                                <td><?php echo $set = round($row['17'], 2);  ?></td>
                                <td><?php echo $get = round($row1['16'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (ug)</td>
                                <td><?php echo $set = round($row['18'], 2);  ?></td>
                                <td><?php echo $get = round($row1['17'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (mga-TE)</td>
                                <td><?php echo $set = round($row['19'], 2);  ?></td>
                                <td><?php echo $get = round($row1['18'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (ug)</td>
                                <td><?php echo $set = round($row['20'], 2);  ?></td>
                                <td><?php echo $get = round($row1['19'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>???????? (mg)</td>
                                <td><?php echo $set = round($row['21'], 2);  ?></td>
                                <td><?php echo $get = round($row1['20'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>???????? (mg)</td>
                                <td><?php echo $set = round($row['22'], 2);  ?></td>
                                <td><?php echo $get = round($row1['21'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????? (mg)</td>
                                <td><?php echo $set = round($row['23'], 2);  ?></td>
                                <td><?php echo $get = round($row1['22'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (ug)</td>
                                <td><?php echo $set = round($row['24'], 2);  ?></td>
                                <td><?php echo $get = round($row1['23'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????????? (mg)</td>
                                <td><?php echo $set = round($row['25'], 2);  ?></td>
                                <td><?php echo $get = round($row1['24'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (mg)</td>
                                <td><?php echo $set = round($row['26'], 2);  ?></td>
                                <td><?php echo $get = round($row1['25'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????? (mg)</td>
                                <td><?php echo $set = round($row['27'], 2);  ?></td>
                                <td><?php echo $get = round($row1['26'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????????? (mg)</td>
                                <td><?php echo $set = round($row['28'], 2);  ?></td>
                                <td><?php echo $get = round($row1['27'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (mg)</td>
                                <td><?php echo $set = round($row['29'], 2);  ?></td>
                                <td><?php echo $get = round($row1['28'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>???????? (mg)</td>
                                <td><?php echo $set = round($row['30'], 2);  ?></td>
                                <td><?php echo $get = round($row1['29'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (ug)</td>
                                <td><?php echo $set = round($row['31'], 2);  ?></td>
                                <td><?php echo $get = round($row1['30'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>????????? (mg)</td>
                                <td><?php echo $set = round($row['32'], 2);  ?></td>
                                <td><?php echo $get = round($row1['31'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>?????????? (ug)</td>
                                <td><?php echo $set = round($row['33'], 2);  ?></td>
                                <td><?php echo $get = round($row1['32'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>???????? (ug)</td>
                                <td><?php echo $set = round($row['34'], 2);  ?></td>
                                <td><?php echo $get = round($row1['33'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              <tr>
                                <td>??????? (mg)</td>
                                <td><?php echo $set = round($row['35'], 2);  ?></td>
                                <td><?php echo $get = round($row1['34'], 2); ?></td>
                                <td><div style="background-color:<?php colorDiv($set,$get); ?>;"><?php percentage($set,$get); ?></div></td>
                              </tr>
                              </tbody>
                            </table>
                            </div>
                            </fieldset>
                            <fieldset class="f-profile" style="width:460px; float:left;margin-bottom: 15px;"><legend class="le-profile">????????????????</legend>
                            <div style="margin: 1px 5px 5px 5px; padding-left:10px;">
                            <table>
                            	<thead>
                                	<tr>
                                    	<th>????</th>
                                        <th>?????</th>
                                        <th>??????</th>
                                        <th>?????</th>
                                        <th>???????</th>
                                    </tr>
                                </thead>
                                <tbody>
                            <?php
								$sql = "SELECT usermenudiet.userid,usermenudiet.menudate,usermenudiet.menumeal,usermenudiet.foodcc, food.foodname, food.foodunit,food.totalcallory FROM usermenudiet LEFT JOIN food ON usermenudiet.foodid = food.foodid WHERE usermenudiet.userid = '$_SESSION[userid]' AND usermenudiet.menudate = STR_TO_DATE('$menudate','%d-%m-%Y')";
								$result = mysql_query($sql);
								$resultkk =	 0;
								while($row=mysql_fetch_object($result)) {
								if ($row->menumeal == '1') {
								$menumeal = "????";
								$img = "Mostly Sunny-48.png";
								} else if ($row->menumeal == '2') {
								$menumeal = "???????";
								$img = "sunny-48.png";
								} else if ($row->menumeal == '3') {
								$menumeal = "????";
								$img = "night-few-clouds-48.png";
								}
							?>
                            <tr>
                            	<td style="text-align:center;"><img style="width:24px; height:24px;" src="images/<?php echo $img; ?>"></td>
                                <td><?php echo $row->foodname; ?></td>
                                <td style="text-align:center;"><?php echo $row->foodcc; ?></td>
                                <td style="text-align:center;"><?php echo $row->foodunit; ?></td>
                                <td style="text-align:center;"><?php echo $total = $row->totalcallory*$row->foodcc; $resultkk += $total; ?></td>
                            </tr>
                            <?php
							}
							mysql_free_result($result);
							?>
                            </tbody>
                            </table>
                            <p style="height:30px;margin:10px 0;"><img style="width:24px; height:24px; vertical-align:middle;" src="images/Mostly Sunny-48.png"> ????????      <img style="width:24px; height:24px; vertical-align:middle;" src="images/sunny-48.png"> ???????????       <img style="width:24px; height:24px; vertical-align:middle;" src="images/night-few-clouds-48.png"> ???????</p>
                            <?php echo "<p>?????????????????????????? ".$resultkk." ???????????</p>"; ?>
                            <?php
								$sql = "SELECT food.foodid, food.foodname FROM food WHERE food.status = '1'";
								$result = mysql_query($sql);
								$foodoption = "";
								while ($row=mysql_fetch_array($result)) {
									$foodoption .= "<option value='{$row[0]}'>{$row[1]}</option>";
								}
								mysql_free_result($result);
								/*
							  $sql = "SELECT  usercourse.userid,usercourse.course,usercourse.courseday,usercourse.coursestartdate,usercourse.courseenddate,usercourse.totalcalorie,usercourse.resultcalorie,usercourse.coursekilo,usercourse.usercourseid FROM usercourse WHERE (SELECT Max(usercourse.usercourseid) FROM usercourse where userid = 'akejionioni') and '$menudate' BETWEEN DATE_FORMAT('usercourse.coursestartdate,'%d-%m-%Y') AND DATE_FORMAT('usercourse.courseenddate,'%d-%m-%Y')";
							  $result = mysql_query($sql);
							  $numrowresult = mysql_num_rows($result);
							  $row = mysql_fetch_array($result);
							  if($numrowresult=1) {
								if ($row['1'] == "1" ) { $coursestr = "?????"; } else { $coursestr = "??"; }
								echo "<p>?????????????{$coursestr}???????????? {$row['7']} ????????</p>";
								echo "<p>??????????????????????????? {$row['6']} ?????????????????</p>";
								if ($resultkk > $row['6']) { $resultstr = $resultkk-$row['6']; echo "<p style='background-color:red;font-weight:bold;'>?????????????????????? $resultstr ???????????</p>"; }
							  }
							  */
							  ?>
                              <form method="post" action="action.php">
                                  <p class="p-profile"><label for="mealdate" class="l-profile">?????? </label><input class="i-profile" type="text" name="mealdate" id="mealdate" /></p>
                                  <p class="p-profile"><label for="menumeal" class="l-profile">???? </label>
                                  <select name="menumeal" class="i-profile" id="menumeal">
                                  <option value="1">????</option>
                                  <option value="2">???????</option>
                                  <option value="3">????</option>
                                  </select></p>
                                  <p class="p-profile"><label for="foodid" class="l-profile">?????</label><select class="i-profile" name="foodid" id="foodid"><? echo $foodoption; ?></select></p>
                                  <p class="p-profile"><label for="foodcc" class="l-profile">??????</label><input class="i-profile" type="text" name="foodcc" id="foodcc" value="1"/></p>
                                  <input type="hidden" name="action" value="reportmeal" />
                                  <p><input type="submit" value="???????????" /> </p>
                               </form>
                            </div>
                            </fieldset>